import 'package:flutter/material.dart';
import 'package:member_center_sdk/sdk.dart';
import 'package:member_center_sdk_example/pages/members/center/page.dart';
import 'package:member_center_sdk_example/utils/device_helper.dart';

Future main() async {
  await initSdk();
  runApp(ReduxApp());
}

Future initSdk() async {
  var deviceId = await DeviceHelper.getDeviceId();
  var deviceName = await DeviceHelper.getDeviceName();
  await MemberCenterSdk.setDeviceInfo(deviceId, deviceName);
}

class ReduxApp extends StatefulWidget {
  @override
  _ReduxAppState createState() => _ReduxAppState();
}

class _ReduxAppState extends State<ReduxApp> {
  @override
  Widget build(BuildContext context) =>
      MaterialApp(home: MemberCenterPage().buildPage(<String, dynamic>{}));
}
